package flc.ast.adapter;

import android.graphics.Color;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;
import stark.common.basic.utils.SPUtil;

public class ImageAdapter extends StkProviderMultiAdapter<Integer> {

    public ImageAdapter() {
        addItemProvider(new StkSingleSpanProvider<>(66));
        addItemProvider(new ImageProvider());
    }

    private class ImageProvider extends BaseItemProvider<Integer> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_image;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, Integer integer) {
            baseViewHolder.setImageResource(R.id.ivImageItemImg,integer);
            if (baseViewHolder.getBindingAdapterPosition()==0){
                baseViewHolder.getView(R.id.ivImageItemImg).setPadding(200,0,0,0);
            }
        }
    }
}
